package com.tanfuqi.sicent.server.controller

import com.tanfuqi.sicent.protocol.message.ShopInfo
import com.tanfuqi.sicent.server.getSession
import org.apache.mina.core.service.IoAcceptor
import org.springframework.beans.factory.annotation.Autowired
import reactor.core.publisher.Mono

abstract class BaseController {
    @Autowired
    val acceptor: IoAcceptor? = null

    internal fun session(shopId: String) = Mono.justOrEmpty<IoAcceptor>(acceptor).getSession(ShopInfo(shopId))

}